package org.fujay.langchain4jserver.domain.model.event;

import org.fujay.langchain4jserver.domain.model.vo.ModelId;
import org.fujay.langchain4jserver.domain.model.vo.TestResult;
import org.springframework.context.ApplicationEvent;

/**
 * 模型链接测试事件
 */
public class ModelConnectionTestedEvent extends ApplicationEvent {

    private final ModelId modelId;
    private final TestResult testResult;

    // Include error message if result is FAILED?

    /**
     * Create a new ModelConnectionTestedEvent.
     *
     * @param source     the component that published the event
     * @param modelId    the ID of the tested model
     * @param testResult the result of the connection test
     */
    public ModelConnectionTestedEvent(Object source, ModelId modelId, TestResult testResult) {
        super(source);
        this.modelId = modelId;
        this.testResult = testResult;
    }

    public ModelId getModelId() {
        return modelId;
    }

    public TestResult getTestResult() {
        return testResult;
    }
}
